<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\UserContext;
use App\Http\Services\CourseOrderService;
use App\Http\Traits\ResponseJson;

class CourseOrderController extends Controller
{
    use ResponseJson;

    protected $courseOrderService;

    public function __construct(CourseOrderService $courseOrderService)
    {
        $this->courseOrderService = $courseOrderService;
    }

    public function lists(UserContext $userContext)
    {
        $data = $this->courseOrderService->lists($userContext);
        return $this->returnJson($data);
    }
    public function createOrder(UserContext $userContext)
    {
        $data = $this->courseOrderService->createOrder($userContext);
        return $this->returnJson($data);
    }
    public function orderDetail(UserContext $userContext)
    {
        $data = $this->courseOrderService->orderDetail($userContext);
        return $this->returnJson($data);
    }

    public function firstOrder(UserContext $userContext)
    {
        $data = $this->courseOrderService->firstOrder($userContext);
        return $this->returnJson($data);
    }

    public function todayCourse(UserContext $userContext)
    {
        $data = $this->courseOrderService->todayCourse($userContext);
        return $this->returnJson($data);
    }

    public function statics(UserContext $userContext)
    {
        $data = $this->courseOrderService->statics($userContext);
        return $this->returnJson($data);
    }

    public function orderCancel(UserContext $userContext)
    {
        $data = $this->courseOrderService->orderCancel($userContext);
        return $this->returnJson($data);
    }

    public function checkApply(UserContext $userContext)
    {
        $data = $this->courseOrderService->checkApply($userContext);
        return $this->returnJson($data);
    }

    public function staticsCount()
    {
        $data = $this->courseOrderService->staticsCount();
        return $this->returnJson($data);
    }

    public function createCheck(UserContext $userContext)
    {
        $data = $this->courseOrderService->createCheck($userContext);
        return $this->returnJson($data);
    }

    public function addLeave(UserContext $userContext)
    {
        $data = $this->courseOrderService->addLeave($userContext);
        return $this->returnJson($data);
    }

    public function submitEstimate(UserContext $userContext)
    {
        $data = $this->courseOrderService->submitEstimate($userContext);
        return $this->returnJson($data);
    }

}
